import request from '@/utils/request'

export function getRolesSelect() {
    return request({
        url: '/rabc/roles/getSelectLists',
        method: 'get'
    })
}

export function getListRole(params, get_url = false) {
    var url = '/rabc/roles';
    if (get_url) return url;
    return request({
        url: url,
        method: 'get',
        params
    })
}

export function createRole(data, get_url = false) {
    var url = `/rabc/roles/create`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'post',
        data
    })
}

export function updateRole(data, get_url = false) {
    var url = `/rabc/roles/update`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'put',
        data
    })
}

export function delRole(data, get_url = false) {
    var url = `/rabc/roles/delete`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'delete',
        data
    })
}

export function changeFiledStatus(data, get_url = false) {
    var url = `/rabc/roles/changeFiledStatus`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'put',
        data
    })
}
